<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="/WEB-INF/jsp/includes.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Gerenciamento dos vendedores</title>
</head>
<body>
<form:form action="vendedor.do" method="post" commandName="vendedor">

		<table>
			<tr>
				<td>ID do vendedor</td>
				<td><form:input path="vendedor_id" /></td>
				<td>Nome do vendedor</td>
				<td><form:input path="nome_vendedor" /></td>
				<td>Rua</td>
				<td><form:input path="endereco.rua" /></td>
				<td>Complemento</td>
				<td><form:input path="endereco.complemento" /></td>
			</tr>



			<tr>
				<td colspan="2"><input type="submit" name="action" value="Add" />
					<input type="submit" name="action" value="Edit" /> <input
					type="submit" name="action" value="Delete" /> <input type="submit"
					name="action" value="Search" /></td>
			</tr>
		</table>
	</form:form>
	<table border="1">
		<th>ID</th>
		<th>Nome</th>
		<th>Rua</th>
		<th>Complemento</th>
		<c:forEach items="${vendedorList}" var="vendedor">
			<tr>
				<td>${vendedor.vendedor_id}</td>
				<td>${vendedor.nome_vendedor}</td>
				<td>${vendedor.endereco.rua}</td>
				<td>${vendedor.endereco.complemento}</td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>